﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MentorBackEnd.Model;
using MentorBackEnd.DA;

namespace MentorBackEnd.Business
{
    public class MentorMatchTagManager
    {
        public static void InsertMentorTagsForUsers(int userID, List<MentorMatchTag> mentorMatchTagList)
        {
            string tagsCSL=null;
            foreach (MentorMatchTag tag in mentorMatchTagList)
            {
                tagsCSL = tagsCSL + tag.MentorMatchTagID.ToString() + ",";
            }
            tagsCSL = tagsCSL.Remove(tagsCSL.Length - 1, 1);
            MentorMatchTagDA.InsertMentorTagsForUsers(userID,  tagsCSL);
            return;
        }

        public static void UpdateMentorTagsForUsers(int userID, List<MentorMatchTag> mentorMatchTagList)
        {
            string tagsCSL = null;
            foreach (MentorMatchTag tag in mentorMatchTagList)
            {
                tagsCSL = tagsCSL + tag.MentorMatchTagID.ToString() + ",";
            }
            tagsCSL = tagsCSL.Remove(tagsCSL.Length - 1, 1);
            MentorMatchTagDA.InsertMentorTagsForUsers(userID, tagsCSL);
            return;
        }


        public static List<MentorMatchTag> GetUserMentorTags(int userID)
        {
            return MentorMatchTagDA.GetUserMentorTags(userID);
        }


    }
}